home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / sg3-utils / examples / Makefile.freebsd next >
Encoding:
Makefile  |  2007-01-15  |  1.3 KB  |  65 lines

  1. SHELL = /bin/sh
  2.  
  3. PREFIX=/usr/local
  4. INSTDIR=$(DESTDIR)/$(PREFIX)/bin
  5. MANDIR=$(DESTDIR)/$(PREFIX)/man
  6.  
  7. CC = gcc
  8. LD = gcc
  9.  
  10. EXECS = sg_simple5
  11.  
  12. MAN_PGS =
  13. MAN_PREF = man8
  14.  
  15. OS_FLAGS = -DSG3_UTILS_FREEBSD
  16. EXTRA_FLAGS = $(OS_FLAGS)
  17.  
  18. # CFLAGS = -O2 -Wall -W $(EXTRA_FLAGS)
  19. CFLAGS = -g -O2 -Wall -W $(EXTRA_FLAGS)
  20. # CFLAGS = -g -O2 -Wall -W -pedantic -std=c99 $(EXTRA_FLAGS)
  21.  
  22. CFLAGS_PTHREADS = -D_REENTRANT
  23.  
  24. # there is no rule to make the following in the parent directory,
  25. # it is assumed they are already built.
  26. D_FILES = ../sg_lib.o ../sg_pt_freebsd.o
  27. O_FILES = sg_lib.o sg_pt_freebsd.o
  28.  
  29. LDFLAGS = -lcam
  30. # LDFLAGS = -v -lm
  31.  
  32. all: $(EXECS)
  33.  
  34. depend dep:
  35.     for i in *.c; do $(CC) $(INCLUDES) $(CFLAGS) -M $$i; \
  36.     done > .depend
  37.  
  38. clean:
  39.     /bin/rm -f *.o $(EXECS) core* .depend *.a *.la *.lo
  40.     /bin/rm -rf .libs
  41.  
  42. sg_simple5: sg_simple5.o $(D_FILES)
  43.     $(LD) -o $@ $(LDFLAGS) $@.o $(D_FILES)
  44.  
  45. install: $(EXECS)
  46.     install -d $(INSTDIR)
  47.     for name in $(EXECS); \
  48.      do install -s -m 755 $$name $(INSTDIR); \
  49.     done
  50.     install -d $(MANDIR)/$(MAN_PREF)
  51.     for mp in $(MAN_PGS); \
  52.      do install -m 644 $$mp $(MANDIR)/$(MAN_PREF); \
  53.      gzip -9f $(MANDIR)/$(MAN_PREF)/$$mp; \
  54.     done
  55.  
  56. uninstall:
  57.     dists="$(EXECS)"; \
  58.     for name in $$dists; do \
  59.      rm -f $(INSTDIR)/$$name; \
  60.     done
  61.     for mp in $(MAN_PGS); do \
  62.      rm -f $(MANDIR)/$(MAN_PREF)/$$mp.gz; \
  63.     done
  64.  
  65.